package com.example.common.feign;

import com.example.common.dto.ApiResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "permission-service", path = "/api/permission")
public interface PermissionFeignClient {

    @PostMapping("/bind-default-role")
    ApiResponse<Void> bindDefaultRole(@RequestParam("userId") Long userId);

    @GetMapping("/user-role")
    ApiResponse<String> getUserRoleCode(@RequestParam("userId") Long userId);

    @PostMapping("/upgrade-to-admin")
    ApiResponse<Void> upgradeToAdmin(@RequestParam("userId") Long userId);

    @PostMapping("/downgrade-to-user")
    ApiResponse<Void> downgradeToUser(@RequestParam("userId") Long userId);
}